package com.hongtech.modules.job.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hongtech.common.TaskException;
import com.hongtech.modules.job.entity.SysJob;
import org.quartz.SchedulerException;

import java.util.List;

public interface SysJobService extends IService<SysJob> {

	void deleteJobByIds(List<String> jobIds) throws SchedulerException;

	boolean checkCronExpressionIsValid(String cronExpression);

	int deleteJob(SysJob job) throws SchedulerException;

	int insertJob(SysJob job) throws SchedulerException, TaskException;

	int updateJob(SysJob sysJob) throws SchedulerException, TaskException;

	void run(SysJob job) throws SchedulerException;

	int changeStatus(SysJob job) throws SchedulerException;

	int pauseJob(SysJob job) throws SchedulerException;

	int resumeJob(SysJob job) throws SchedulerException;

	List<SysJob> listSysJobs(SysJob sysJob, String[] dateRanges);

	SysJob getSysJobById(String jobId);

}
